package com.example.test.advice.第四章_字符串.建议53_注意方法中传递的参数要求;

import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * replace和replaceAll区别
 * replace替换的是字符串
 * replaceAll替换的是正则表达式
 */
public class StringUtils {
    //删除字符串
    public static String remove(String source,String sub){

        return source.replace(sub,"");
    }

    public static void main(String[] args) {
        assertTrue(StringUtils.remove("好是好","好").equals("是"));

        assertTrue(StringUtils.remove("$是$","$").equals("是"));
    }
}
